ποΈGitΠ―ΡΠ°ποΈ
Node / meshtastic / Meshtastic-Android / files / specs / 20260711-153545-message-markdown-styling / contracts / output-transformation.md
specs/20260711-153545-message-markdown-styling/contracts/output-transformation.md docs/obtainium-generated-deeplinks (42f311dd) Text, 1.88 KB
Contract: Live in-field styling (OutputTransformation)
Location: T383838feature/messaging/src/commonMain/kotlin/org/meshtastic/feature/messaging/Message.kt
Change: add a markdown T383838OutputTransformation and compose it with the existing T383838mentionOutputTransformation on the compose field's T383838TextFieldState.
API: Compose Multiplatform 1.11.1 T383838androidx.compose.foundation.text.input.OutputTransformation / T383838TextFieldBuffer.addStyle.
Behavioral contract
βββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ
β ID β Given β Then β
βββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββ€
β O-1 β draft T383838see **this** β field displays "this" bold live β¦ β
β O-2 β draft with a mention + markdown β both the T383838@Name substitution and β¦ β
β O-3 β any styling applied β T383838TextFieldState.text (the stored/β¦ β
β O-4 β draft with no markdown β field renders plain (no spuriousβ¦ β
β O-5 β send / byte-truncation / quick-chat programmatic edits β no crash from stale selection/ofβ¦ β
βββββββ΄βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββ
Invariants
β’ Transformation is display-only: it MUST NOT mutate T383838TextFieldState.text. Styling is applied via T383838TextFieldBuffer.addStyle on the displayed buffer only.
β’ Must compose with (not replace) the mention transformation β either a single combined transformation or a well-defined chain; the combined result must keep offsets valid.
β’ Works on both Android and desktop (shared T383838commonMain).
Verification note
Because T383838OutputTransformation composition is the one novel integration risk (research R5/R6 open risk), it MUST be exercised live per quickstart β not only via tests β driving: type markdown, type a mention, mix both, send, quick-chat append, and byte-limit truncation, watching for correct styling and no offset crash.
Served by rngit 1.5.2 - Generated in 0.05s